    <template>
  <div id="DeliverDetails">
    <v-detail
      :detailData="inputData.detailData"
      :inputConfig="inputConfig"
      :rules="rules"
      @pop="setData"
      ref="input"
    ></v-detail>
  </div>
</template>

<script>
import detail from "commons/Detail";
import baseMixin from "@/mixins/BaseMixin";

export default {
  name: "DeliverDetails",
  mixins: [baseMixin],
  props: {
    inputData: {
      type: Object
    }
  },
  data () {
    return {
      rules: {
      },
      whseidflag: false
    }
  },
  computed: {
    inputConfig () {
      return [
        [
          {
            type: "input",
            label: this.$t('bill.goodsGroup',{no:1}),
            props: "skugroup",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('bill.goodsGroup',{no:2}),
            props: "skugroup2",
            disabled: this.whseidflag
          },
        ],
        [
          {
            type: "select",
            label: this.$t('config.freightclass'),
            props: "freightclass",
            options: this.getOptions('querycodeLkup/FREIGHTCLS'),
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.nmfcclass'),
            props: "nmfcclass",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.mateabilitycode'),
            props: "mateabilitycode",
            disabled: this.whseidflag
          },
        ],
        [
          {
            type: "select",
            label: this.$t('config.transportationmode'),
            props: "transportationmode",
            options: this.getOptions('querycodeLkup/TRANSPMODE'),
            disabled: this.whseidflag
          },
          {
            type: "table",
            label: this.$t('config.hazmatcodeskey'),
            props: "hazmatcodeskey",
            tableConfig: [
              {
                label: this.$t('config.hazmatcodeskey'),
                prop: "hazmatcodeskey",
                input: "input",
              },
              {
                label: this.$t('config.uncode'),
                prop: "uncode",
                input: "input",
              },
            ],
            url: `/querySeachButton/enterprise.hazmatcodes/1=1/serialkey/?/${this.$store.state.wms}`,
            disabled: this.whseidflag
          },
          {
            type: "checkbox",
            label: this.$t('config.vertStorage'),
            props: "vert_Storage",
            disabled: this.whseidflag
          },
          {
            type: "checkbox",
            label: this.$t('config.shippablecontainer'),
            props: "shippablecontainer",
            disabled: this.whseidflag
          },
        ],
        [
          {
            type: "select",
            label: this.$t('config.transportationservice'),
            props: "transportationservice",
            options: this.getOptions('querycodeLkup/TRANSERVCS'),
            disabled: this.whseidflag
          }
        ]
      ]
    }
  },
  methods: {
    setData (data, id, close, listId) {
      this.inputData.detailData.hazmatcodeskey = data.hazmatcodeskey;
      close(false);
    }
  },
  mounted () {
    if (this.$store.state.wms.toUpperCase().includes('WMWHSE')) {
      //仓库级
      this.whseidflag = true;
    }
  },
  components: {
    "v-detail": detail
  }
}
</script>

<style scoped>
</style>
